//
//  TLChengYu.m
//  Books
//
//  Created by tao故乡的云 on 2017/3/16.
//  Copyright © 2017年 故乡的云. All rights reserved.
//

#import "TLChengYu.h"

@implementation TLChengYu
+ (instancetype)chengYuWithDict:(NSDictionary *)dict {
    TLChengYu *cy = [[TLChengYu alloc] init];
    [cy setValuesForKeysWithDictionary:dict];
    return cy;
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:self.name forKey:@"name"];
    [aCoder encodeObject:self.pinYin forKey:@"pinYin"];
    [aCoder encodeObject:self.zhuShi forKey:@"zhuShi"];
    [aCoder encodeObject:self.liJu forKey:@"liJu"];
    [aCoder encodeObject:self.dianGu forKey:@"dianGu"];
    [aCoder encodeObject:self.index forKey:@"index"];
    [aCoder encodeBool:self.love forKey:@"love"];
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self.name = [aDecoder decodeObjectForKey:@"name"];
    self.pinYin = [aDecoder decodeObjectForKey:@"pinYin"];
    self.zhuShi = [aDecoder decodeObjectForKey:@"zhuShi"];
    self.liJu = [aDecoder decodeObjectForKey:@"liJu"];
    self.dianGu = [aDecoder decodeObjectForKey:@"dianGu"];
    self.index = [aDecoder decodeObjectForKey:@"index"];
    self.love = [aDecoder decodeBoolForKey:@"love"];
    return self;
}
@end
///** name */
//@property (nonatomic,copy) NSString *name;
///** 拼音 */
//@property (nonatomic,copy) NSString *pinYin;
///** 注释内容 */
//@property (nonatomic,copy) NSString *zhuShi;
///** 例句 */
//@property (nonatomic,copy) NSString *liJu;
///** 典故 */
//@property (nonatomic,copy) NSString *dianGu;
///** 字母索引 */
//@property (nonatomic,copy) NSString *index;
///** 收藏 */
//@property (nonatomic,assign,getter=isLove) bool love;
